<!DOCTYPE html>
<html>
  <head>
    <title><%= Setting.fetch "app_name" %></title>
    <%= csrf_meta_tags %>
    <%= csp_meta_tag %>

    <%= stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track': 'reload' %>
    <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
  </head>

  <body>
  <div class="page">
      <div class="page-main">
        <div class="header py-4">
          <div class="container">
            <div class="d-flex">
              <a class="header-brand" href="<%= admin_root_path %>">
                <%= image_tag("logo.png", class: "header-brand-img") %>
                <%= Setting.fetch "app_name" %>公司总后台
              </a>
              <% if current_admin %>
              <div class="d-flex order-lg-2 ml-auto">
                <!--
                <div class="dropdown d-none d-md-flex">
                  <a class="nav-link icon" data-toggle="dropdown">
                    <i class="fe fe-bell"></i>
                    <span class="nav-unread"></span>
                  </a>
                  <div class="dropdown-menu dropdown-menu-right dropdown-menu-arrow">
                    <a href="#" class="dropdown-item d-flex">
                      <span class="avatar mr-3 align-self-center" style="background-image: url(demo/faces/male/41.jpg)"></span>
                      <div>
                        <strong>Nathan</strong> pushed new commit: Fix page load performance issue.
                        <div class="small text-muted">10 minutes ago</div>
                      </div>
                    </a>
                    <a href="#" class="dropdown-item d-flex">
                      <span class="avatar mr-3 align-self-center" style="background-image: url(demo/faces/female/1.jpg)"></span>
                      <div>
                        <strong>Alice</strong> started new task: Tabler UI design.
                        <div class="small text-muted">1 hour ago</div>
                      </div>
                    </a>
                    <a href="#" class="dropdown-item d-flex">
                      <span class="avatar mr-3 align-self-center" style="background-image: url(demo/faces/female/18.jpg)"></span>
                      <div>
                        <strong>Rose</strong> deployed new version of NodeJS REST Api V3
                        <div class="small text-muted">2 hours ago</div>
                      </div>
                    </a>
                    <div class="dropdown-divider"></div>
                    <a href="#" class="dropdown-item text-center text-muted-dark">Mark all as read</a>
                  </div>
                </div>
                -->
                <div class="dropdown">
                  <a href="#" class="nav-link pr-0 leading-none" data-toggle="dropdown">
                    <span class="avatar" style="background-image: url(<%= asset_path("25.jpg") %>)"></span>
                    <span class="ml-2 d-none d-lg-block">
                      <span class="text-default"><%= current_admin.nickname %></span>
                      <small class="text-muted d-block mt-1">管理员</small>
                    </span>
                  </a>
                  <div class="dropdown-menu dropdown-menu-right dropdown-menu-arrow">
                    <a class="dropdown-item" href="<%= edit_admin_admin_path(current_admin) %>">
                      <i class="dropdown-icon fe fe-user"></i> 设置
                    </a>
                    <%= link_to admin_session_path(0), class: "dropdown-item", method: :delete do %>
                      <i class="dropdown-icon fe fe-log-out"></i> 注销
                    <% end %>
                  </div>
                </div>
              </div>
              <a href="#" class="header-toggler d-lg-none ml-3 ml-lg-0" data-toggle="collapse" data-target="#headerMenuCollapse">
                <span class="header-toggler-icon"></span>
              </a>
              <% end %>
            </div>
          </div>
        </div>

        <% if current_admin %>
        <div class="header collapse d-lg-flex p-0" id="headerMenuCollapse">
          <div class="container">
            <div class="row align-items-center">
              <div class="col-lg-3 ml-auto">
                <% if controller_name == "users" %>
                  <form action="<%= admin_users_path %>" method="get" class="input-icon my-3 my-lg-0">
                    <input type="search" name="search_key" class="form-control header-search" placeholder="用户手机号" tabindex="1">
                    <div class="input-icon-addon">
                      <i class="fe fe-search"></i>
                    </div>
                  </form>
                <% end %>
              </div>
              <div class="col-lg order-lg-first">
                <ul class="nav nav-tabs border-0 flex-column flex-lg-row">
                  <li class="nav-item">
                    <a href="<%= admin_root_path %>" class="nav-link <%= "active" if is_active?('home') %>"><i class="fe fe-home"></i> 首页</a>
                  </li>
                  <li class="nav-item">
                    <a href="javascript:void(0)" class="nav-link <%= "active" if is_active?('shop_categories') %>" data-toggle="dropdown"><i class="fe fe-box"></i> 分类管理</a>
                    <div class="dropdown-menu dropdown-menu-arrow">
                      <a href="<%= new_admin_shop_category_path %>" class="dropdown-item ">创建根分类</a>
                      <a href="<%= admin_shop_categories_path %>" class="dropdown-item ">分类列表</a>
                      <a href="<%= new_admin_brand_path %>" class="dropdown-item ">创建品牌</a>
                      <a href="<%= admin_brands_path %>" class="dropdown-item ">品牌列表</a>
                    </div>
                  </li>
                  <li class="nav-item dropdown">
                    <a href="javascript:void(0)" class="nav-link" data-toggle="dropdown"><i class="fe fe-check-square"></i> 用户管理</a>
                    <div class="dropdown-menu dropdown-menu-arrow">
                      <a href="<%= admin_users_path %>" class="dropdown-item ">用户列表</a>
                      <a href="<%= admin_feedbacks_path %>" class="dropdown-item ">用户反馈</a>
                      <a href="<%= admin_memberships_path %>" class="dropdown-item ">会员等级管理</a>
                    </div>
                  </li>
                  <li class="nav-item dropdown">
                    <a href="javascript:void(0)" class="nav-link" data-toggle="dropdown"><i class="fe fe-file"></i> 商家管理</a>
                    <div class="dropdown-menu dropdown-menu-arrow">
                      <a href="<%= new_admin_shop_path %>" class="dropdown-item ">新增商家</a>
                      <a href="<%= admin_shops_path %>" class="dropdown-item ">商家列表</a>
                      <a href="<%= admin_settles_path %>" class="dropdown-item ">结算列表</a>
                      <a href="<%= admin_spus_path %>" class="dropdown-item ">商品审核</a>
                    </div>
                  </li>
                  <li class="nav-item dropdown">
                    <a href="javascript:void(0)" class="nav-link" data-toggle="dropdown"><i class="fe fe-file"></i> 频道活动</a>
                    <div class="dropdown-menu dropdown-menu-arrow">
                      <a href="<%= admin_channels_path %>" class="dropdown-item ">频道管理</a>
                      <a href="<%= admin_hot_tags_path %>" class="dropdown-item ">首页热门标签管理</a>
                      <a href="<%= admin_actives_path %>" class="dropdown-item ">精华页管理</a>
                      <a href="<%= admin_seckill_spus_path %>" class="dropdown-item ">限时购管理</a>
                      <a href="<%= admin_coupons_path %>" class="dropdown-item ">优惠券管理</a>
                      <a href="<%= admin_scratch_card_awards_path %>" class="dropdown-item ">刮刮卡奖品管理</a>
                      <a href="<%= admin_user_scratch_card_awards_path %>" class="dropdown-item ">刮刮卡中奖管理</a>
                    </div>
                  </li>
                  <li class="nav-item dropdown">
                    <a href="javascript:void(0)" class="nav-link" data-toggle="dropdown"><i class="fe fe-file"></i> 供求信息管理</a>
                    <div class="dropdown-menu dropdown-menu-arrow">
                      <a href="<%= admin_topics_path %>" class="dropdown-item ">供求信息列表</a>
                    </div>
                  </li>
                  <li class="nav-item dropdown">
                    <a href="javascript:void(0)" class="nav-link" data-toggle="dropdown"><i class="fe fe-file"></i> 轮播图广告</a>
                    <div class="dropdown-menu dropdown-menu-arrow">
                      <a href="<%= new_admin_swiper_path %>" class="dropdown-item ">新增轮播图</a>
                      <a href="<%= admin_swipers_path %>" class="dropdown-item ">轮播图列表</a>
                      <a href="<%= new_admin_advertisement_path %>" class="dropdown-item ">新增广告</a>
                      <a href="<%= admin_advertisements_path %>" class="dropdown-item ">广告列表</a>
                    </div>
                  </li>
                  <li class="nav-item dropdown">
                    <a href="javascript:void(0)" class="nav-link" data-toggle="dropdown"><i class="fe fe-file"></i> 系统设置</a>
                    <div class="dropdown-menu dropdown-menu-arrow">
                      <a href="<%= admin_admins_path %>" class="dropdown-item ">管理员列表</a>
                      <a href="<%= admin_settings_path %>" class="dropdown-item ">基础设置</a>
                      <a href="<%= admin_service_items_path %>" class="dropdown-item ">服务条款设置</a>
                      <a href="<%= admin_seckill_times_path %>" class="dropdown-item ">限时购时间设置</a>
                      <a href="<%= admin_logistics_companies_path %>" class="dropdown-item ">物流公司设置</a>
                      <a href="<%= admin_refund_reasons_path %>" class="dropdown-item ">退款原因设置</a>
                      <a href="<%= admin_shop_types_path %>" class="dropdown-item ">门店类型设置</a>
                      <a href="<%= admin_deposit_preferences_path %>" class="dropdown-item ">充值优惠设置</a>
                    </div>
                  </li>
                </ul>
              </div>
            </div>
          </div>
        </div>
        <% end %>
        
        <div class="my-3 my-md-5">
          <div class="container">
            <%= notice_message %>
            <% if controller_name != 'sessions' %>
            <nav aria-label="breadcrumb">
              <ol class="breadcrumb">
                <li class="breadcrumb-item"><a href="<%= admin_root_path %>">首页</a></li>
                <% if controller_name != 'home' %>
                <li class="breadcrumb-item"><a href="#"><%= i18n_model controller_name %></a></li>
                <% end %>
                <li class="breadcrumb-item active" aria-current="page"><%= i18n_action action_name %></li>
              </ol>
            </nav>
            <% end %>
            <%= yield %>
          </div>
        </div>
      </div>
      <footer class="footer">
        <div class="container">
          <div class="row align-items-center flex-row-reverse">
            <div class="col-auto ml-lg-auto">
            </div>
            <div class="col-12 col-lg-auto mt-3 mt-lg-0 text-center">
              Copyright © 2018 <a href="."><%= Setting.fetch "app_name" %></a>. by <a href="http://mform.cn" target="_blank">mform.cn</a> All rights reserved.
            </div>
          </div>
        </div>
      </footer>
    </div>
  </body>
</html>
